package com.deyuanyun.pic.settings.mapper.pipe;

import com.deyuanyun.pic.settings.controller.dto.PipeValidateVO;
import com.deyuanyun.pic.settings.controller.dto.PipeValveRoomInfraVO;
import com.deyuanyun.pic.settings.controller.dto.ValveRoomDTO;
import com.deyuanyun.pic.settings.domain.pipe.ValveRoom;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface ValveRoomMapper {

    int deleteByPrimaryKey(String id);

    int insert(ValveRoomDTO record);

    int insertSelective(ValveRoomDTO record);

    ValveRoomDTO selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(ValveRoomDTO record);

    int updateByPrimaryKey(ValveRoomDTO record);


	void insertValveRoom(PipeValveRoomInfraVO pipeValveRoomInfraVO);

	List<ValveRoomDTO> findByCondition(PipeValveRoomInfraVO pipeValveRoomInfraVO);

    /**
     * 批量删除未发布的场站阀室
     * @param
     * @return 
     * @author axiao(xj08.dream@gmail.com)
     * @date 2016-09-01
     */
	int deleteByIds(@Param("ids") String[] ids);
	
    /**
     * 批量发布未发布的场站阀室
     * @param
     * @return 
     * @author axiao(xj08.dream@gmail.com)
     * @date 2016-09-01
     */
	int updateStatus(@Param("ids") String[] ids);

    /**
     * 场站阀室启批量启用、停用
     * @param ids
     * @param status 启用状态：不为空为启用
     * @return 
     * @author axiao(xj08.dream@gmail.com)
     * @date 2016-09-01
     */
	int updateVRS(@Param("ids") String[] ids, @Param("status") String status);

	void updateVR(PipeValveRoomInfraVO pipeValveRoomInfraVO);

	/**
	 * 验证场站阀室的名字或者代号是否重复
	 * @param pipeValidateVO
	 * @return 
	 * @author axiao(xj08.dream@gmail.com)
	 * @date 2016-11-25
	 */
	int validateRepByVR(PipeValidateVO pipeValidateVO);

	List<ValveRoom> queryAllValueRoomList(Map map);


	public List<Map> queryValueRoomListByLineId(Map map);

	/**
	 * 查询所有的已发布已启用的场站阀室,或根据名字模糊查询
	 * @param name 场站阀室名称
	 * @return
	 */
	List<ValveRoomDTO> queryAllValueRooms(@Param("name") String name);

	public ValveRoomDTO getValueRoomByName(@Param("name") String name);

	/**
	 * 查询管道经过的场站阀室
	 *
	 * @param map
	 * @return
     */
	public List<Map> queryValueRoom(Map map);

}